package com.guoxin.singleton.lazy;

/**
 * 懒汉式(线程安全，同步方法)
 *
 * @author guoxin
 * @date 2019/8/15
 */
public class Safe {

    private static Safe instance;

    private Safe() {
    }

    public synchronized static Safe getInstance() {
        if (instance == null) {
            instance = new Safe();
        }
        return instance;
    }
}
